package com.css.devops.constants;

/**
 * 常量类
 */
public interface DevopsConstants {

	/**
	 * Jenkins pipeline
	 */
	String JENKINS_PIPELINE_MONITOR_ENDPOINT = "/blue/rest/organizations/jenkins/pipelines/%s/branches/%s/runs/%s/nodes/?limit=10000";
	//String JENKINS_PIPELINE_MONITOR_ENDPOINT = "/blue/rest/organizations/jenkins/pipelines/" + pipeline + "/branches/" + branch + "/runs/" + buildNumber + "/nodes/?limit=10000";
	
	/**
	 * Jenkins pipeline stage
	 */
	String JENKINS_MONITOR_ENDPOINT = "/blue/rest/organizations/jenkins/pipelines/%s/runs/?start=%d&limit=%d";
	//"/blue/rest/organizations/jenkins/pipelines/" + pipeline + "/runs/?start=0&limit=26";
	
	/**
	 * add job to view
	 */
	String JENKINS_ADD_JOB_2_VIEW = "/view/%s/addJobToView";
	
	/**
	 * delete job to view
	 */
	String JENKINS_REMOVE_JOB_2_VIEW = "/view/%s/removeJobFromView";
	
	/**
	 * 构建详情
	 */
	String JENKINS_JOB_BUILD_DETAILS = "/job/%s/job/%s/wfapi/runs?fullStages=true";
	
	/**
	 * 分页最大数
	 */
	Integer MAX_LIMIT = 1000;
	
	/**
	 * Jenkins登录地址
	 */
	String JENKINS_LOGIN_URL = "%/j_spring_security_check";
	/**
	 * 获取crumb的url
	 */
	String JENKINS_CRUMB = "%s/crumbIssuer/api/json";
	/**
	 * 构建日志
	 */
	String JENKINS_BUILD_JOB_LOG = "%s/job/%s/job/%s/%d/consoleText";
	
	/**
	 * 执行脚本url
	 */
	String JENKINS_SCRIPT = "/script";
	
	/**
	 * 任务最后一次构建url
	 */
	//http://192.168.94.1:18080/job/fresco-web/job/master/childrenContextMenu
	String JENKINS_JOB_LAST_BUILD = "/job/%s/job/%s/lastBuild/api/xml";
}
